package com.rou.im.framework.core.request;

import com.rou.im.framework.core.Serializer;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2020-05-21 16:34
 */
public class RequestHeader implements RequestAttributes{

    private Integer cmdId;
    //客户端版本号
    private int clientVersion;
    //消息序列号
    private int seq;
    //消息体长度
    private int bodyLength;

    private String token;

    private String logLevel;

    private String serializerType;

    private Map<String,Object> attributeMap = new ConcurrentHashMap<>();

    @Override
    public Object getAttribute(String name) {
        return this.attributeMap.get(name);
    }

    @Override
    public void setAttribute(String name, Object value) {
        this.attributeMap.put(name,value);
    }

    @Override
    public void removeAttribute(String name) {
        this.attributeMap.remove(name);
    }

    public Integer getCmdId() {
        return cmdId;
    }

    public void setCmdId(Integer cmdId) {
        this.cmdId = cmdId;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(String logLevel) {
        this.logLevel = logLevel;
    }

    public String getSerializerType() {
        return serializerType;
    }

    public void setSerializerType(String serializerType) {
        this.serializerType = serializerType;
    }

    public int getClientVersion() {
        return clientVersion;
    }

    public void setClientVersion(int clientVersion) {
        this.clientVersion = clientVersion;
    }

    public int getSeq() {
        return seq;
    }

    public void setSeq(int seq) {
        this.seq = seq;
    }

    public int getBodyLength() {
        return bodyLength;
    }

    public void setBodyLength(int bodyLength) {
        this.bodyLength = bodyLength;
    }
}
